<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		.box{
			width: 200px;
			height: 200px;
			background: red url() 0 0 no-repeat;
		}
	</style>
	<script>
		
		window.onload= function () {
			
			box = document.getElementsByClassName('box');
			console.log(box);

			is = true;
			
			box[0].onclick =  function () {

				if(is){
					box[0].style.width ="400px";
					is = false;
				}else{
					box[0].style.width ="200px";
					is = true;
				}

			}

			box[0].ondblclick =  function () {

				box[0].style.width ="200px";

			}

			box[0].onmouseover = function(){
				box[0].style.backgroundColor = "blue";
			}




			
			text = document.getElementById('text');


			text.onfocus = function () {
				text.style.border = "1px solid red";
				text.style.outline ="none";
			}

			text.onblur = function () {
				text.style.border = "1px solid #333";
			}

			text.onchange = function () {
				text.style.border = "1px solid blue";
			}

		}
	</script>
</head>
<body>
	<div class="box"></div>
	<input type="text" id="text">
</body>
</html>